package com.liuhong.shoping.common;
/**
 * 分页实体
 * 使用方式:	
 * 1.目标实体继承自该Page
 * 2.调整查询语句
 * 3.查询前调用setPage()
 * 4.查询后调用setTotalCount()
 */
public class PageEntity {

	private int pageSize;	// 分页大小 每页几条
	
	private int currentPage;	//	当前页码
	
	private int totalCount;	//	总数
	
	private int totalPageNum;	//	总页数(暂时无用)
	
	private int skipNum;	//	跳过行数
	
	private int begin;	//	数据起始位置
	
	private int end;	//	数据截止位置

	public PageEntity() {
		super();
//		this.setPage();
	}

	public void setPage() {
		this.begin = this.pageSize * (this.currentPage - 1);
		this.end = this.pageSize * this.currentPage;
		// 现版本优先使用 第一页1
		this.skipNum = ((this.currentPage > 0?this.currentPage:1) - 1)*this.pageSize;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getTotalPageNum() {
		return totalPageNum;
	}

	public void setTotalPageNum(int totalPageNum) {
		this.totalPageNum = totalPageNum;
	}

	public int getSkipNum() {
		return skipNum;
	}

	public void setSkipNum(int skipNum) {
		this.skipNum = skipNum;
	}

	public int getBegin() {
		return begin;
	}

	public void setBegin(int begin) {
		this.begin = begin;
	}

	public int getEnd() {
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}
	
	
	
}